package com.ykht.proj.comsrv.handle;


import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
import com.ykht.proj.comsrv.entity.VSubscribeMsg;
import com.ykht.proj.comsrv.vo.SubscribeMsg;
import me.chanjar.weixin.common.error.WxErrorException;

/**
 * 订阅消息接口
 */
public abstract class AbstractSubscribeMsgHandler<T> implements SubscribeMsgHandler<T>{

	@Override
	public final void handle(SubscribeMsg msg) throws Exception {
		VSubscribeMsg vSubscribeMsg = checkSend(msg);
		if (vSubscribeMsg!=null){
			//组装
			T transform = transform(msg);
			//处理逻辑
			send(transform);
			//保存数据
			save(vSubscribeMsg,transform,msg);
		}
	}

}
